home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Development Kits / HyperCard Related / APDA HyperCard Toolkits / HyperCard CTB Toolkit 1.0b2 / Source Code / CTBResetTerminal.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.3 KB  |  61 lines  |  [TEXT/MPS ]

  1. (*
  2.     CTBResetTerminal -- Reset the terminal emulator.
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w CTBResetTerminal.p
  7.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=2760 -sn Main=CTBResetTerminal ∂
  8.             CTBResetTerminal.p.o "{MPW}"Libraries:interface.o "{MPW}"Libraries:Libraries:HyperXLib.o
  9.  
  10.     © Copyright 1990 by Apple Computer, Inc.
  11.  
  12.     Initial coding 2/90 by Harry R. Chesley.
  13. *)
  14.  
  15. {$R-}
  16.  
  17. {$S CTBResetTerminal }     { Segment name must be the same as the command name. }
  18.  
  19. unit DummyUnit;
  20.  
  21. interface
  22.  
  23. uses MemTypes, QuickDraw, OSIntf, ToolIntf, CTBUtils, FTIntf, CMIntf, TMIntf, CRMIntf, HyperXCmd;
  24.  
  25. procedure EntryPoint(paramPtr: XCmdPtr);
  26.     
  27. implementation
  28.  
  29. procedure CTBResetTerminal(paramPtr: XCmdPtr); forward;
  30.  
  31. procedure EntryPoint(paramPtr: XCmdPtr);
  32.  
  33.     begin
  34.         CTBResetTerminal(paramPtr);
  35.     end;
  36.  
  37. procedure CTBResetTerminal(paramPtr: XCmdPtr);
  38.  
  39.     {$I CTBUtil.inc}
  40.  
  41.     procedure Fail(errMsg: Str255); { set theResult and quit }
  42.         begin
  43.             paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
  44.             exit(CTBResetTerminal);
  45.         end;
  46.  
  47.     begin
  48.         { Check the parameter count. }
  49.         if paramPtr^.paramCount > 0 then Fail('Invalid parameter count');
  50.  
  51.         { Make sure the Comm Toolbox is ready. }
  52.         CTBReady;
  53.         { And we have a terminal tool. }
  54.         EnsurePresent(terminalTool);
  55.  
  56.         { Reset the tool. }
  57.         TMReset(Globals^^.termHand);
  58.     end;
  59.  
  60. end.
  61.